/**
 * 
 */
package t4j.strings;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sz
 *
 * create time：2012-11-23
 */
public class InfiniteRecursion {

	public  void test(){
		System.out.println(this);
	}


	@Override
	public String toString() {
		
		// return "InfiniteRecursion address:" +this+ "\n"; //因为重写了这个类的toString（）方法，所以this调用的时候就是死循环
		return "InfiniteRecursion address:" +super.toString()+ "\n"; //调用会父类object的就没事了
	}
	
	public static void main(String[] args) {
		List<InfiniteRecursion> v = new ArrayList<InfiniteRecursion>();
		
		for(int i = 0 ; i< 10 ; i++)
			v.add(new InfiniteRecursion());
		
		System.out.println(v);
		
	
		
	}
}
